// $ANTLR 3.2 Sep 23, 2009 12:02:23 U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g 2010-12-01 00:03:23

// The variable 'variable' is assigned but its value is never used.
#pragma warning disable 168, 219
// Unreachable code detected.
#pragma warning disable 162


  using System.Text;
  using System.Collections.Generic;
  using Open.Web.Stijl.Css;


using System;
using Antlr.Runtime;
using IList 		= System.Collections.IList;
using ArrayList 	= System.Collections.ArrayList;
using Stack 		= Antlr.Runtime.Collections.StackList;



using Antlr.Runtime.Tree;

namespace  Open.Web.Stijl.Parsing 
{
public partial class Css3Parser : Parser
{
    public static readonly string[] tokenNames = new string[] 
	{
        "<invalid>", 
		"<EOR>", 
		"<DOWN>", 
		"<UP>", 
		"ATTRIBEQUAL", 
		"HASVALUE", 
		"BEGINSWITH", 
		"IDENT", 
		"STRING", 
		"WS", 
		"SL_COMMENT", 
		"COMMENT", 
		"'@import'", 
		"'@include'", 
		"';'", 
		"'@media'", 
		"'{'", 
		"'}'", 
		"','", 
		"'@'", 
		"':'", 
		"'::'", 
		"'>'", 
		"'+'", 
		"'['", 
		"']'", 
		"'='", 
		"'~='", 
		"'|='", 
		"'('", 
		"')'"
    };

    public const int T__29 = 29;
    public const int T__28 = 28;
    public const int T__27 = 27;
    public const int BEGINSWITH = 6;
    public const int T__26 = 26;
    public const int T__25 = 25;
    public const int T__24 = 24;
    public const int HASVALUE = 5;
    public const int T__23 = 23;
    public const int T__22 = 22;
    public const int T__21 = 21;
    public const int T__20 = 20;
    public const int ATTRIBEQUAL = 4;
    public const int EOF = -1;
    public const int T__30 = 30;
    public const int T__19 = 19;
    public const int WS = 9;
    public const int T__16 = 16;
    public const int T__15 = 15;
    public const int T__18 = 18;
    public const int T__17 = 17;
    public const int T__12 = 12;
    public const int T__14 = 14;
    public const int T__13 = 13;
    public const int SL_COMMENT = 10;
    public const int IDENT = 7;
    public const int COMMENT = 11;
    public const int STRING = 8;

    // delegates
    // delegators



        public Css3Parser(ITokenStream input)
    		: this(input, new RecognizerSharedState()) {
        }

        public Css3Parser(ITokenStream input, RecognizerSharedState state)
    		: base(input, state) {
            InitializeCyclicDFAs();

             
        }
        
    protected ITreeAdaptor adaptor = new CommonTreeAdaptor();

    public ITreeAdaptor TreeAdaptor
    {
        get { return this.adaptor; }
        set {
    	this.adaptor = value;
    	}
    }

    override public string[] TokenNames {
		get { return Css3Parser.tokenNames; }
    }

    override public string GrammarFileName {
		get { return "U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g"; }
    }


      public List<object> Components { get; set; }


    public class stylesheet_return : ParserRuleReturnScope
    {
        private object tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (object) value; }
        }
    };

    // $ANTLR start "stylesheet"
    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:41:1: stylesheet : ( importRule )* (mg= mediaGroup | ns= nested | rs= ruleset )+ ;
    public Css3Parser.stylesheet_return stylesheet() // throws RecognitionException [1]
    {   
        Css3Parser.stylesheet_return retval = new Css3Parser.stylesheet_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        Css3Parser.mediaGroup_return mg = default(Css3Parser.mediaGroup_return);

        Css3Parser.nested_return ns = default(Css3Parser.nested_return);

        Css3Parser.ruleset_return rs = default(Css3Parser.ruleset_return);

        Css3Parser.importRule_return importRule1 = default(Css3Parser.importRule_return);




          Components = new List<object>();

        try 
    	{
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:46:2: ( ( importRule )* (mg= mediaGroup | ns= nested | rs= ruleset )+ )
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:47:2: ( importRule )* (mg= mediaGroup | ns= nested | rs= ruleset )+
            {
            	root_0 = (object)adaptor.GetNilNode();

            	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:47:2: ( importRule )*
            	do 
            	{
            	    int alt1 = 2;
            	    int LA1_0 = input.LA(1);

            	    if ( ((LA1_0 >= 12 && LA1_0 <= 13)) )
            	    {
            	        alt1 = 1;
            	    }


            	    switch (alt1) 
            		{
            			case 1 :
            			    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:48:3: importRule
            			    {
            			    	PushFollow(FOLLOW_importRule_in_stylesheet95);
            			    	importRule1 = importRule();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, importRule1.Tree);

            			    }
            			    break;

            			default:
            			    goto loop1;
            	    }
            	} while (true);

            	loop1:
            		;	// Stops C# compiler whining that label 'loop1' has no statements

            	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:50:2: (mg= mediaGroup | ns= nested | rs= ruleset )+
            	int cnt2 = 0;
            	do 
            	{
            	    int alt2 = 4;
            	    switch ( input.LA(1) ) 
            	    {
            	    case 15:
            	    	{
            	        alt2 = 1;
            	        }
            	        break;
            	    case 19:
            	    	{
            	        alt2 = 2;
            	        }
            	        break;
            	    case IDENT:
            	    case 24:
            	    	{
            	        alt2 = 3;
            	        }
            	        break;

            	    }

            	    switch (alt2) 
            		{
            			case 1 :
            			    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:51:3: mg= mediaGroup
            			    {
            			    	PushFollow(FOLLOW_mediaGroup_in_stylesheet108);
            			    	mg = mediaGroup();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, mg.Tree);

            			    }
            			    break;
            			case 2 :
            			    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:51:19: ns= nested
            			    {
            			    	 if (mg != null) Components.Add(((mg != null) ? mg.group : default(MediaGroup))); 
            			    	PushFollow(FOLLOW_nested_in_stylesheet118);
            			    	ns = nested();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, ns.Tree);

            			    }
            			    break;
            			case 3 :
            			    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:52:15: rs= ruleset
            			    {
            			    	 if (ns != null) Components.Add(((ns != null) ? ns.rule : default(RuleSet))); 
            			    	PushFollow(FOLLOW_ruleset_in_stylesheet128);
            			    	rs = ruleset();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, rs.Tree);
            			    	 if (rs != null) Components.Add(((rs != null) ? rs.rule : default(RuleSet))); 

            			    }
            			    break;

            			default:
            			    if ( cnt2 >= 1 ) goto loop2;
            		            EarlyExitException eee2 =
            		                new EarlyExitException(2, input);
            		            throw eee2;
            	    }
            	    cnt2++;
            	} while (true);

            	loop2:
            		;	// Stops C# compiler whining that label 'loop2' has no statements


            }

            retval.Stop = input.LT(-1);

            	retval.Tree = (object)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "stylesheet"

    public class importRule_return : ParserRuleReturnScope
    {
        public Function importUrl;
        private object tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (object) value; }
        }
    };

    // $ANTLR start "importRule"
    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:57:1: importRule returns [Function importUrl] : ( '@import' | '@include' ) function ( ';' )? ;
    public Css3Parser.importRule_return importRule() // throws RecognitionException [1]
    {   
        Css3Parser.importRule_return retval = new Css3Parser.importRule_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken set2 = null;
        IToken char_literal4 = null;
        Css3Parser.function_return function3 = default(Css3Parser.function_return);


        object set2_tree=null;
        object char_literal4_tree=null;

        try 
    	{
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:58:2: ( ( '@import' | '@include' ) function ( ';' )? )
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:58:4: ( '@import' | '@include' ) function ( ';' )?
            {
            	root_0 = (object)adaptor.GetNilNode();

            	set2 = (IToken)input.LT(1);
            	if ( (input.LA(1) >= 12 && input.LA(1) <= 13) ) 
            	{
            	    input.Consume();
            	    adaptor.AddChild(root_0, (object)adaptor.Create(set2));
            	    state.errorRecovery = false;
            	}
            	else 
            	{
            	    MismatchedSetException mse = new MismatchedSetException(null,input);
            	    throw mse;
            	}

            	PushFollow(FOLLOW_function_in_importRule158);
            	function3 = function();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, function3.Tree);
            	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:58:39: ( ';' )?
            	int alt3 = 2;
            	int LA3_0 = input.LA(1);

            	if ( (LA3_0 == 14) )
            	{
            	    alt3 = 1;
            	}
            	switch (alt3) 
            	{
            	    case 1 :
            	        // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:58:39: ';'
            	        {
            	        	char_literal4=(IToken)Match(input,14,FOLLOW_14_in_importRule160); 
            	        		char_literal4_tree = (object)adaptor.Create(char_literal4);
            	        		adaptor.AddChild(root_0, char_literal4_tree);


            	        }
            	        break;

            	}


            			if (String.Equals(((function3 != null) ? function3.function : default(Function)).Name, "url", StringComparison.InvariantCultureIgnoreCase))
            				Components.Add(new Import(((function3 != null) ? function3.function : default(Function)).Arguments));
            			else
            				Components.Add(input.ToString((IToken)retval.Start,input.LT(-1)));
            		

            }

            retval.Stop = input.LT(-1);

            	retval.Tree = (object)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "importRule"

    public class mediaGroup_return : ParserRuleReturnScope
    {
        public MediaGroup group;
        private object tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (object) value; }
        }
    };

    // $ANTLR start "mediaGroup"
    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:67:1: mediaGroup returns [MediaGroup group] : '@media' identList '{' ruleSetGroup '}' ;
    public Css3Parser.mediaGroup_return mediaGroup() // throws RecognitionException [1]
    {   
        Css3Parser.mediaGroup_return retval = new Css3Parser.mediaGroup_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken string_literal5 = null;
        IToken char_literal7 = null;
        IToken char_literal9 = null;
        Css3Parser.identList_return identList6 = default(Css3Parser.identList_return);

        Css3Parser.ruleSetGroup_return ruleSetGroup8 = default(Css3Parser.ruleSetGroup_return);


        object string_literal5_tree=null;
        object char_literal7_tree=null;
        object char_literal9_tree=null;

        try 
    	{
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:68:2: ( '@media' identList '{' ruleSetGroup '}' )
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:68:4: '@media' identList '{' ruleSetGroup '}'
            {
            	root_0 = (object)adaptor.GetNilNode();

            	string_literal5=(IToken)Match(input,15,FOLLOW_15_in_mediaGroup179); 
            		string_literal5_tree = (object)adaptor.Create(string_literal5);
            		adaptor.AddChild(root_0, string_literal5_tree);

            	PushFollow(FOLLOW_identList_in_mediaGroup181);
            	identList6 = identList();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, identList6.Tree);
            	char_literal7=(IToken)Match(input,16,FOLLOW_16_in_mediaGroup183); 
            		char_literal7_tree = (object)adaptor.Create(char_literal7);
            		adaptor.AddChild(root_0, char_literal7_tree);

            	PushFollow(FOLLOW_ruleSetGroup_in_mediaGroup185);
            	ruleSetGroup8 = ruleSetGroup();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, ruleSetGroup8.Tree);
            	char_literal9=(IToken)Match(input,17,FOLLOW_17_in_mediaGroup187); 
            		char_literal9_tree = (object)adaptor.Create(char_literal9);
            		adaptor.AddChild(root_0, char_literal9_tree);

            	 retval.group =  new MediaGroup(((identList6 != null) ? input.ToString((IToken)(identList6.Start),(IToken)(identList6.Stop)) : null), ((ruleSetGroup8 != null) ? ruleSetGroup8.rules : default(List<RuleSet>))); 

            }

            retval.Stop = input.LT(-1);

            	retval.Tree = (object)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "mediaGroup"

    public class identList_return : ParserRuleReturnScope
    {
        public List<string> idents;
        private object tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (object) value; }
        }
    };

    // $ANTLR start "identList"
    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:71:1: identList returns [List<string> idents] : i1= IDENT ( ',' i2= IDENT )* ;
    public Css3Parser.identList_return identList() // throws RecognitionException [1]
    {   
        Css3Parser.identList_return retval = new Css3Parser.identList_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken i1 = null;
        IToken i2 = null;
        IToken char_literal10 = null;

        object i1_tree=null;
        object i2_tree=null;
        object char_literal10_tree=null;


        	retval.idents =  new List<string>();

        try 
    	{
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:75:2: (i1= IDENT ( ',' i2= IDENT )* )
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:75:4: i1= IDENT ( ',' i2= IDENT )*
            {
            	root_0 = (object)adaptor.GetNilNode();

            	i1=(IToken)Match(input,IDENT,FOLLOW_IDENT_in_identList211); 
            		i1_tree = (object)adaptor.Create(i1);
            		adaptor.AddChild(root_0, i1_tree);

            	 retval.idents.Add(((i1 != null) ? i1.Text : null)); 
            	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:76:4: ( ',' i2= IDENT )*
            	do 
            	{
            	    int alt4 = 2;
            	    int LA4_0 = input.LA(1);

            	    if ( (LA4_0 == 18) )
            	    {
            	        alt4 = 1;
            	    }


            	    switch (alt4) 
            		{
            			case 1 :
            			    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:77:5: ',' i2= IDENT
            			    {
            			    	char_literal10=(IToken)Match(input,18,FOLLOW_18_in_identList224); 
            			    		char_literal10_tree = (object)adaptor.Create(char_literal10);
            			    		adaptor.AddChild(root_0, char_literal10_tree);

            			    	i2=(IToken)Match(input,IDENT,FOLLOW_IDENT_in_identList233); 
            			    		i2_tree = (object)adaptor.Create(i2);
            			    		adaptor.AddChild(root_0, i2_tree);

            			    	 if (i2 != null) retval.idents.Add(((i2 != null) ? i2.Text : null)); 

            			    }
            			    break;

            			default:
            			    goto loop4;
            	    }
            	} while (true);

            	loop4:
            		;	// Stops C# compiler whining that label 'loop4' has no statements


            }

            retval.Stop = input.LT(-1);

            	retval.Tree = (object)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "identList"

    public class ruleSetGroup_return : ParserRuleReturnScope
    {
        public List<RuleSet> rules;
        private object tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (object) value; }
        }
    };

    // $ANTLR start "ruleSetGroup"
    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:82:1: ruleSetGroup returns [List<RuleSet> rules] : ( ruleset )* ;
    public Css3Parser.ruleSetGroup_return ruleSetGroup() // throws RecognitionException [1]
    {   
        Css3Parser.ruleSetGroup_return retval = new Css3Parser.ruleSetGroup_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        Css3Parser.ruleset_return ruleset11 = default(Css3Parser.ruleset_return);




        	retval.rules =  new List<RuleSet>();

        try 
    	{
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:86:2: ( ( ruleset )* )
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:86:4: ( ruleset )*
            {
            	root_0 = (object)adaptor.GetNilNode();

            	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:86:4: ( ruleset )*
            	do 
            	{
            	    int alt5 = 2;
            	    int LA5_0 = input.LA(1);

            	    if ( (LA5_0 == IDENT || LA5_0 == 24) )
            	    {
            	        alt5 = 1;
            	    }


            	    switch (alt5) 
            		{
            			case 1 :
            			    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:87:3: ruleset
            			    {
            			    	PushFollow(FOLLOW_ruleset_in_ruleSetGroup265);
            			    	ruleset11 = ruleset();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, ruleset11.Tree);
            			    	 retval.rules.Add(((ruleset11 != null) ? ruleset11.rule : default(RuleSet))); 

            			    }
            			    break;

            			default:
            			    goto loop5;
            	    }
            	} while (true);

            	loop5:
            		;	// Stops C# compiler whining that label 'loop5' has no statements


            }

            retval.Stop = input.LT(-1);

            	retval.Tree = (object)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "ruleSetGroup"

    public class nested_return : ParserRuleReturnScope
    {
        public RuleSet rule;
        private object tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (object) value; }
        }
    };

    // $ANTLR start "nested"
    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:91:1: nested returns [RuleSet rule] : '@' nest '{' ( properties )? ( nested )* '}' ;
    public Css3Parser.nested_return nested() // throws RecognitionException [1]
    {   
        Css3Parser.nested_return retval = new Css3Parser.nested_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken char_literal12 = null;
        IToken char_literal14 = null;
        IToken char_literal17 = null;
        Css3Parser.nest_return nest13 = default(Css3Parser.nest_return);

        Css3Parser.properties_return properties15 = default(Css3Parser.properties_return);

        Css3Parser.nested_return nested16 = default(Css3Parser.nested_return);


        object char_literal12_tree=null;
        object char_literal14_tree=null;
        object char_literal17_tree=null;

        try 
    	{
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:92:3: ( '@' nest '{' ( properties )? ( nested )* '}' )
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:92:5: '@' nest '{' ( properties )? ( nested )* '}'
            {
            	root_0 = (object)adaptor.GetNilNode();

            	char_literal12=(IToken)Match(input,19,FOLLOW_19_in_nested288); 
            		char_literal12_tree = (object)adaptor.Create(char_literal12);
            		adaptor.AddChild(root_0, char_literal12_tree);

            	PushFollow(FOLLOW_nest_in_nested290);
            	nest13 = nest();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, nest13.Tree);
            	char_literal14=(IToken)Match(input,16,FOLLOW_16_in_nested292); 
            		char_literal14_tree = (object)adaptor.Create(char_literal14);
            		adaptor.AddChild(root_0, char_literal14_tree);

            	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:92:18: ( properties )?
            	int alt6 = 2;
            	int LA6_0 = input.LA(1);

            	if ( (LA6_0 == IDENT) )
            	{
            	    alt6 = 1;
            	}
            	switch (alt6) 
            	{
            	    case 1 :
            	        // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:92:18: properties
            	        {
            	        	PushFollow(FOLLOW_properties_in_nested294);
            	        	properties15 = properties();
            	        	state.followingStackPointer--;

            	        	adaptor.AddChild(root_0, properties15.Tree);

            	        }
            	        break;

            	}

            	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:92:30: ( nested )*
            	do 
            	{
            	    int alt7 = 2;
            	    int LA7_0 = input.LA(1);

            	    if ( (LA7_0 == 19) )
            	    {
            	        alt7 = 1;
            	    }


            	    switch (alt7) 
            		{
            			case 1 :
            			    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:92:30: nested
            			    {
            			    	PushFollow(FOLLOW_nested_in_nested297);
            			    	nested16 = nested();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, nested16.Tree);

            			    }
            			    break;

            			default:
            			    goto loop7;
            	    }
            	} while (true);

            	loop7:
            		;	// Stops C# compiler whining that label 'loop7' has no statements

            	char_literal17=(IToken)Match(input,17,FOLLOW_17_in_nested300); 
            		char_literal17_tree = (object)adaptor.Create(char_literal17);
            		adaptor.AddChild(root_0, char_literal17_tree);


            	 		RuleSet ruleSet = RuleSetFactory.Create("@" + ((nest13 != null) ? input.ToString((IToken)(nest13.Start),(IToken)(nest13.Stop)) : null), ((properties15 != null) ? properties15.properties : default(List<Declaration>)));
            	 		Components.Add(ruleSet);
            	 		retval.rule =  ruleSet;
            	 	

            }

            retval.Stop = input.LT(-1);

            	retval.Tree = (object)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "nested"

    public class nest_return : ParserRuleReturnScope
    {
        private object tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (object) value; }
        }
    };

    // $ANTLR start "nest"
    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:99:1: nest : IDENT ( IDENT )* ( pseudo )* ;
    public Css3Parser.nest_return nest() // throws RecognitionException [1]
    {   
        Css3Parser.nest_return retval = new Css3Parser.nest_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken IDENT18 = null;
        IToken IDENT19 = null;
        Css3Parser.pseudo_return pseudo20 = default(Css3Parser.pseudo_return);


        object IDENT18_tree=null;
        object IDENT19_tree=null;

        try 
    	{
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:100:2: ( IDENT ( IDENT )* ( pseudo )* )
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:100:4: IDENT ( IDENT )* ( pseudo )*
            {
            	root_0 = (object)adaptor.GetNilNode();

            	IDENT18=(IToken)Match(input,IDENT,FOLLOW_IDENT_in_nest315); 
            		IDENT18_tree = (object)adaptor.Create(IDENT18);
            		adaptor.AddChild(root_0, IDENT18_tree);

            	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:100:10: ( IDENT )*
            	do 
            	{
            	    int alt8 = 2;
            	    int LA8_0 = input.LA(1);

            	    if ( (LA8_0 == IDENT) )
            	    {
            	        alt8 = 1;
            	    }


            	    switch (alt8) 
            		{
            			case 1 :
            			    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:100:10: IDENT
            			    {
            			    	IDENT19=(IToken)Match(input,IDENT,FOLLOW_IDENT_in_nest317); 
            			    		IDENT19_tree = (object)adaptor.Create(IDENT19);
            			    		adaptor.AddChild(root_0, IDENT19_tree);


            			    }
            			    break;

            			default:
            			    goto loop8;
            	    }
            	} while (true);

            	loop8:
            		;	// Stops C# compiler whining that label 'loop8' has no statements

            	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:100:17: ( pseudo )*
            	do 
            	{
            	    int alt9 = 2;
            	    int LA9_0 = input.LA(1);

            	    if ( ((LA9_0 >= 20 && LA9_0 <= 21)) )
            	    {
            	        alt9 = 1;
            	    }


            	    switch (alt9) 
            		{
            			case 1 :
            			    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:100:17: pseudo
            			    {
            			    	PushFollow(FOLLOW_pseudo_in_nest320);
            			    	pseudo20 = pseudo();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, pseudo20.Tree);

            			    }
            			    break;

            			default:
            			    goto loop9;
            	    }
            	} while (true);

            	loop9:
            		;	// Stops C# compiler whining that label 'loop9' has no statements


            }

            retval.Stop = input.LT(-1);

            	retval.Tree = (object)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "nest"

    public class pseudo_return : ParserRuleReturnScope
    {
        private object tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (object) value; }
        }
    };

    // $ANTLR start "pseudo"
    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:103:1: pseudo : ( ( ':' | '::' ) IDENT | ( ':' | '::' ) function );
    public Css3Parser.pseudo_return pseudo() // throws RecognitionException [1]
    {   
        Css3Parser.pseudo_return retval = new Css3Parser.pseudo_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken set21 = null;
        IToken IDENT22 = null;
        IToken set23 = null;
        Css3Parser.function_return function24 = default(Css3Parser.function_return);


        object set21_tree=null;
        object IDENT22_tree=null;
        object set23_tree=null;

        try 
    	{
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:104:2: ( ( ':' | '::' ) IDENT | ( ':' | '::' ) function )
            int alt10 = 2;
            int LA10_0 = input.LA(1);

            if ( ((LA10_0 >= 20 && LA10_0 <= 21)) )
            {
                int LA10_1 = input.LA(2);

                if ( (LA10_1 == IDENT) )
                {
                    int LA10_2 = input.LA(3);

                    if ( (LA10_2 == 29) )
                    {
                        alt10 = 2;
                    }
                    else if ( (LA10_2 == 16 || (LA10_2 >= 20 && LA10_2 <= 21)) )
                    {
                        alt10 = 1;
                    }
                    else 
                    {
                        NoViableAltException nvae_d10s2 =
                            new NoViableAltException("", 10, 2, input);

                        throw nvae_d10s2;
                    }
                }
                else 
                {
                    NoViableAltException nvae_d10s1 =
                        new NoViableAltException("", 10, 1, input);

                    throw nvae_d10s1;
                }
            }
            else 
            {
                NoViableAltException nvae_d10s0 =
                    new NoViableAltException("", 10, 0, input);

                throw nvae_d10s0;
            }
            switch (alt10) 
            {
                case 1 :
                    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:104:4: ( ':' | '::' ) IDENT
                    {
                    	root_0 = (object)adaptor.GetNilNode();

                    	set21 = (IToken)input.LT(1);
                    	if ( (input.LA(1) >= 20 && input.LA(1) <= 21) ) 
                    	{
                    	    input.Consume();
                    	    adaptor.AddChild(root_0, (object)adaptor.Create(set21));
                    	    state.errorRecovery = false;
                    	}
                    	else 
                    	{
                    	    MismatchedSetException mse = new MismatchedSetException(null,input);
                    	    throw mse;
                    	}

                    	IDENT22=(IToken)Match(input,IDENT,FOLLOW_IDENT_in_pseudo339); 
                    		IDENT22_tree = (object)adaptor.Create(IDENT22);
                    		adaptor.AddChild(root_0, IDENT22_tree);


                    }
                    break;
                case 2 :
                    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:105:4: ( ':' | '::' ) function
                    {
                    	root_0 = (object)adaptor.GetNilNode();

                    	set23 = (IToken)input.LT(1);
                    	if ( (input.LA(1) >= 20 && input.LA(1) <= 21) ) 
                    	{
                    	    input.Consume();
                    	    adaptor.AddChild(root_0, (object)adaptor.Create(set23));
                    	    state.errorRecovery = false;
                    	}
                    	else 
                    	{
                    	    MismatchedSetException mse = new MismatchedSetException(null,input);
                    	    throw mse;
                    	}

                    	PushFollow(FOLLOW_function_in_pseudo351);
                    	function24 = function();
                    	state.followingStackPointer--;

                    	adaptor.AddChild(root_0, function24.Tree);

                    }
                    break;

            }
            retval.Stop = input.LT(-1);

            	retval.Tree = (object)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "pseudo"

    public class ruleset_return : ParserRuleReturnScope
    {
        public RuleSet rule;
        private object tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (object) value; }
        }
    };

    // $ANTLR start "ruleset"
    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:108:1: ruleset returns [RuleSet rule] : selectors '{' ( properties )? '}' ;
    public Css3Parser.ruleset_return ruleset() // throws RecognitionException [1]
    {   
        Css3Parser.ruleset_return retval = new Css3Parser.ruleset_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken char_literal26 = null;
        IToken char_literal28 = null;
        Css3Parser.selectors_return selectors25 = default(Css3Parser.selectors_return);

        Css3Parser.properties_return properties27 = default(Css3Parser.properties_return);


        object char_literal26_tree=null;
        object char_literal28_tree=null;

        try 
    	{
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:109:3: ( selectors '{' ( properties )? '}' )
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:109:5: selectors '{' ( properties )? '}'
            {
            	root_0 = (object)adaptor.GetNilNode();

            	PushFollow(FOLLOW_selectors_in_ruleset367);
            	selectors25 = selectors();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, selectors25.Tree);
            	char_literal26=(IToken)Match(input,16,FOLLOW_16_in_ruleset369); 
            		char_literal26_tree = (object)adaptor.Create(char_literal26);
            		adaptor.AddChild(root_0, char_literal26_tree);

            	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:109:19: ( properties )?
            	int alt11 = 2;
            	int LA11_0 = input.LA(1);

            	if ( (LA11_0 == IDENT) )
            	{
            	    alt11 = 1;
            	}
            	switch (alt11) 
            	{
            	    case 1 :
            	        // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:109:19: properties
            	        {
            	        	PushFollow(FOLLOW_properties_in_ruleset371);
            	        	properties27 = properties();
            	        	state.followingStackPointer--;

            	        	adaptor.AddChild(root_0, properties27.Tree);

            	        }
            	        break;

            	}

            	char_literal28=(IToken)Match(input,17,FOLLOW_17_in_ruleset374); 
            		char_literal28_tree = (object)adaptor.Create(char_literal28);
            		adaptor.AddChild(root_0, char_literal28_tree);

            	 
            	 		RuleSet ruleSet = RuleSetFactory.Create(((selectors25 != null) ? selectors25.selectorSet : default(string)), ((properties27 != null) ? properties27.properties : default(List<Declaration>))); 
            	 		retval.rule =  ruleSet;
            	 	

            }

            retval.Stop = input.LT(-1);

            	retval.Tree = (object)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "ruleset"

    public class selectors_return : ParserRuleReturnScope
    {
        public string selectorSet;
        private object tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (object) value; }
        }
    };

    // $ANTLR start "selectors"
    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:116:1: selectors returns [string selectorSet] : s1= selector ( ',' s2= selector )* ;
    public Css3Parser.selectors_return selectors() // throws RecognitionException [1]
    {   
        Css3Parser.selectors_return retval = new Css3Parser.selectors_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken char_literal29 = null;
        Css3Parser.selector_return s1 = default(Css3Parser.selector_return);

        Css3Parser.selector_return s2 = default(Css3Parser.selector_return);


        object char_literal29_tree=null;


        	StringBuilder sb = new StringBuilder();

        try 
    	{
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:123:2: (s1= selector ( ',' s2= selector )* )
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:123:4: s1= selector ( ',' s2= selector )*
            {
            	root_0 = (object)adaptor.GetNilNode();

            	PushFollow(FOLLOW_selector_in_selectors406);
            	s1 = selector();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, s1.Tree);
            	 sb.Append(((s1 != null) ? s1.selectorText : default(string))); 
            	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:124:3: ( ',' s2= selector )*
            	do 
            	{
            	    int alt12 = 2;
            	    int LA12_0 = input.LA(1);

            	    if ( (LA12_0 == 18) )
            	    {
            	        alt12 = 1;
            	    }


            	    switch (alt12) 
            		{
            			case 1 :
            			    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:125:3: ',' s2= selector
            			    {
            			    	char_literal29=(IToken)Match(input,18,FOLLOW_18_in_selectors417); 
            			    		char_literal29_tree = (object)adaptor.Create(char_literal29);
            			    		adaptor.AddChild(root_0, char_literal29_tree);

            			    	PushFollow(FOLLOW_selector_in_selectors421);
            			    	s2 = selector();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, s2.Tree);
            			    	 sb.AppendFormat(",{0}", ((s2 != null) ? s2.selectorText : default(string))); 

            			    }
            			    break;

            			default:
            			    goto loop12;
            	    }
            	} while (true);

            	loop12:
            		;	// Stops C# compiler whining that label 'loop12' has no statements


            }

            retval.Stop = input.LT(-1);

            	retval.Tree = (object)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);

            	retval.selectorSet =  sb.ToString();

        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "selectors"

    public class selector_return : ParserRuleReturnScope
    {
        public string selectorText;
        private object tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (object) value; }
        }
    };

    // $ANTLR start "selector"
    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:129:1: selector returns [string selectorText] : (i= IDENT ( (s1= ( '>' | '+' | ':' ) )? (i2= IDENT | a1= attrib | f2= function ) )* | s3= attrib ) ;
    public Css3Parser.selector_return selector() // throws RecognitionException [1]
    {   
        Css3Parser.selector_return retval = new Css3Parser.selector_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken i = null;
        IToken s1 = null;
        IToken i2 = null;
        Css3Parser.attrib_return a1 = default(Css3Parser.attrib_return);

        Css3Parser.function_return f2 = default(Css3Parser.function_return);

        Css3Parser.attrib_return s3 = default(Css3Parser.attrib_return);


        object i_tree=null;
        object s1_tree=null;
        object i2_tree=null;


        	StringBuilder sb = new StringBuilder();

        try 
    	{
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:136:2: ( (i= IDENT ( (s1= ( '>' | '+' | ':' ) )? (i2= IDENT | a1= attrib | f2= function ) )* | s3= attrib ) )
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:136:4: (i= IDENT ( (s1= ( '>' | '+' | ':' ) )? (i2= IDENT | a1= attrib | f2= function ) )* | s3= attrib )
            {
            	root_0 = (object)adaptor.GetNilNode();

            	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:136:4: (i= IDENT ( (s1= ( '>' | '+' | ':' ) )? (i2= IDENT | a1= attrib | f2= function ) )* | s3= attrib )
            	int alt16 = 2;
            	int LA16_0 = input.LA(1);

            	if ( (LA16_0 == IDENT) )
            	{
            	    alt16 = 1;
            	}
            	else if ( (LA16_0 == 24) )
            	{
            	    alt16 = 2;
            	}
            	else 
            	{
            	    NoViableAltException nvae_d16s0 =
            	        new NoViableAltException("", 16, 0, input);

            	    throw nvae_d16s0;
            	}
            	switch (alt16) 
            	{
            	    case 1 :
            	        // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:136:5: i= IDENT ( (s1= ( '>' | '+' | ':' ) )? (i2= IDENT | a1= attrib | f2= function ) )*
            	        {
            	        	i=(IToken)Match(input,IDENT,FOLLOW_IDENT_in_selector456); 
            	        		i_tree = (object)adaptor.Create(i);
            	        		adaptor.AddChild(root_0, i_tree);

            	        	 sb.Append(((i != null) ? i.Text : null)); 
            	        	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:137:3: ( (s1= ( '>' | '+' | ':' ) )? (i2= IDENT | a1= attrib | f2= function ) )*
            	        	do 
            	        	{
            	        	    int alt15 = 2;
            	        	    int LA15_0 = input.LA(1);

            	        	    if ( (LA15_0 == IDENT || LA15_0 == 20 || (LA15_0 >= 22 && LA15_0 <= 24)) )
            	        	    {
            	        	        alt15 = 1;
            	        	    }


            	        	    switch (alt15) 
            	        		{
            	        			case 1 :
            	        			    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:138:4: (s1= ( '>' | '+' | ':' ) )? (i2= IDENT | a1= attrib | f2= function )
            	        			    {
            	        			    	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:138:6: (s1= ( '>' | '+' | ':' ) )?
            	        			    	int alt13 = 2;
            	        			    	int LA13_0 = input.LA(1);

            	        			    	if ( (LA13_0 == 20 || (LA13_0 >= 22 && LA13_0 <= 23)) )
            	        			    	{
            	        			    	    alt13 = 1;
            	        			    	}
            	        			    	switch (alt13) 
            	        			    	{
            	        			    	    case 1 :
            	        			    	        // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:138:6: s1= ( '>' | '+' | ':' )
            	        			    	        {
            	        			    	        	s1 = (IToken)input.LT(1);
            	        			    	        	if ( input.LA(1) == 20 || (input.LA(1) >= 22 && input.LA(1) <= 23) ) 
            	        			    	        	{
            	        			    	        	    input.Consume();
            	        			    	        	    adaptor.AddChild(root_0, (object)adaptor.Create(s1));
            	        			    	        	    state.errorRecovery = false;
            	        			    	        	}
            	        			    	        	else 
            	        			    	        	{
            	        			    	        	    MismatchedSetException mse = new MismatchedSetException(null,input);
            	        			    	        	    throw mse;
            	        			    	        	}


            	        			    	        }
            	        			    	        break;

            	        			    	}

            	        			    	 if (!String.IsNullOrEmpty(((s1 != null) ? s1.Text : null))) sb.Append(((s1 != null) ? s1.Text : null)); else sb.Append(' '); 
            	        			    	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:139:6: (i2= IDENT | a1= attrib | f2= function )
            	        			    	int alt14 = 3;
            	        			    	int LA14_0 = input.LA(1);

            	        			    	if ( (LA14_0 == IDENT) )
            	        			    	{
            	        			    	    int LA14_1 = input.LA(2);

            	        			    	    if ( (LA14_1 == 29) )
            	        			    	    {
            	        			    	        alt14 = 3;
            	        			    	    }
            	        			    	    else if ( (LA14_1 == IDENT || LA14_1 == 16 || LA14_1 == 18 || LA14_1 == 20 || (LA14_1 >= 22 && LA14_1 <= 24)) )
            	        			    	    {
            	        			    	        alt14 = 1;
            	        			    	    }
            	        			    	    else 
            	        			    	    {
            	        			    	        NoViableAltException nvae_d14s1 =
            	        			    	            new NoViableAltException("", 14, 1, input);

            	        			    	        throw nvae_d14s1;
            	        			    	    }
            	        			    	}
            	        			    	else if ( (LA14_0 == 24) )
            	        			    	{
            	        			    	    alt14 = 2;
            	        			    	}
            	        			    	else 
            	        			    	{
            	        			    	    NoViableAltException nvae_d14s0 =
            	        			    	        new NoViableAltException("", 14, 0, input);

            	        			    	    throw nvae_d14s0;
            	        			    	}
            	        			    	switch (alt14) 
            	        			    	{
            	        			    	    case 1 :
            	        			    	        // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:140:7: i2= IDENT
            	        			    	        {
            	        			    	        	i2=(IToken)Match(input,IDENT,FOLLOW_IDENT_in_selector500); 
            	        			    	        		i2_tree = (object)adaptor.Create(i2);
            	        			    	        		adaptor.AddChild(root_0, i2_tree);

            	        			    	        	 sb.Append(((i2 != null) ? i2.Text : null)); 

            	        			    	        }
            	        			    	        break;
            	        			    	    case 2 :
            	        			    	        // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:141:9: a1= attrib
            	        			    	        {
            	        			    	        	PushFollow(FOLLOW_attrib_in_selector514);
            	        			    	        	a1 = attrib();
            	        			    	        	state.followingStackPointer--;

            	        			    	        	adaptor.AddChild(root_0, a1.Tree);
            	        			    	        	 sb.Append(((a1 != null) ? input.ToString((IToken)(a1.Start),(IToken)(a1.Stop)) : null)); 

            	        			    	        }
            	        			    	        break;
            	        			    	    case 3 :
            	        			    	        // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:142:9: f2= function
            	        			    	        {
            	        			    	        	PushFollow(FOLLOW_function_in_selector529);
            	        			    	        	f2 = function();
            	        			    	        	state.followingStackPointer--;

            	        			    	        	adaptor.AddChild(root_0, f2.Tree);
            	        			    	        	 sb.Append(((f2 != null) ? input.ToString((IToken)(f2.Start),(IToken)(f2.Stop)) : null)); 

            	        			    	        }
            	        			    	        break;

            	        			    	}


            	        			    }
            	        			    break;

            	        			default:
            	        			    goto loop15;
            	        	    }
            	        	} while (true);

            	        	loop15:
            	        		;	// Stops C# compiler whining that label 'loop15' has no statements


            	        }
            	        break;
            	    case 2 :
            	        // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:146:3: s3= attrib
            	        {
            	        	PushFollow(FOLLOW_attrib_in_selector557);
            	        	s3 = attrib();
            	        	state.followingStackPointer--;

            	        	adaptor.AddChild(root_0, s3.Tree);
            	        	 if (!String.IsNullOrEmpty(((s3 != null) ? input.ToString((IToken)(s3.Start),(IToken)(s3.Stop)) : null))) sb.Append(((s3 != null) ? input.ToString((IToken)(s3.Start),(IToken)(s3.Stop)) : null)); 

            	        }
            	        break;

            	}


            }

            retval.Stop = input.LT(-1);

            	retval.Tree = (object)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);

            	retval.selectorText =  sb.ToString();

        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "selector"

    public class properties_return : ParserRuleReturnScope
    {
        public List<Declaration> properties;
        private object tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (object) value; }
        }
    };

    // $ANTLR start "properties"
    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:150:1: properties returns [List<Declaration> properties] : d1= declaration ( ';' d2= declaration )* ( ';' )? ;
    public Css3Parser.properties_return properties() // throws RecognitionException [1]
    {   
        Css3Parser.properties_return retval = new Css3Parser.properties_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken char_literal30 = null;
        IToken char_literal31 = null;
        Css3Parser.declaration_return d1 = default(Css3Parser.declaration_return);

        Css3Parser.declaration_return d2 = default(Css3Parser.declaration_return);


        object char_literal30_tree=null;
        object char_literal31_tree=null;


        	retval.properties =  new List<Declaration>();

        try 
    	{
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:154:2: (d1= declaration ( ';' d2= declaration )* ( ';' )? )
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:154:4: d1= declaration ( ';' d2= declaration )* ( ';' )?
            {
            	root_0 = (object)adaptor.GetNilNode();

            	PushFollow(FOLLOW_declaration_in_properties588);
            	d1 = declaration();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, d1.Tree);
            	 retval.properties.Add(((d1 != null) ? d1.declaration : default(Declaration))); 
            	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:156:3: ( ';' d2= declaration )*
            	do 
            	{
            	    int alt17 = 2;
            	    int LA17_0 = input.LA(1);

            	    if ( (LA17_0 == 14) )
            	    {
            	        int LA17_1 = input.LA(2);

            	        if ( (LA17_1 == IDENT) )
            	        {
            	            alt17 = 1;
            	        }


            	    }


            	    switch (alt17) 
            		{
            			case 1 :
            			    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:156:4: ';' d2= declaration
            			    {
            			    	char_literal30=(IToken)Match(input,14,FOLLOW_14_in_properties598); 
            			    		char_literal30_tree = (object)adaptor.Create(char_literal30);
            			    		adaptor.AddChild(root_0, char_literal30_tree);

            			    	PushFollow(FOLLOW_declaration_in_properties602);
            			    	d2 = declaration();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, d2.Tree);
            			    	 if (d2 != null) retval.properties.Add(((d2 != null) ? d2.declaration : default(Declaration))); 

            			    }
            			    break;

            			default:
            			    goto loop17;
            	    }
            	} while (true);

            	loop17:
            		;	// Stops C# compiler whining that label 'loop17' has no statements

            	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:159:3: ( ';' )?
            	int alt18 = 2;
            	int LA18_0 = input.LA(1);

            	if ( (LA18_0 == 14) )
            	{
            	    alt18 = 1;
            	}
            	switch (alt18) 
            	{
            	    case 1 :
            	        // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:159:3: ';'
            	        {
            	        	char_literal31=(IToken)Match(input,14,FOLLOW_14_in_properties616); 
            	        		char_literal31_tree = (object)adaptor.Create(char_literal31);
            	        		adaptor.AddChild(root_0, char_literal31_tree);


            	        }
            	        break;

            	}


            }

            retval.Stop = input.LT(-1);

            	retval.Tree = (object)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "properties"

    public class attrib_return : ParserRuleReturnScope
    {
        private object tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (object) value; }
        }
    };

    // $ANTLR start "attrib"
    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:162:1: attrib : '[' IDENT ( attribRelate ( STRING | IDENT ) )? ']' ;
    public Css3Parser.attrib_return attrib() // throws RecognitionException [1]
    {   
        Css3Parser.attrib_return retval = new Css3Parser.attrib_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken char_literal32 = null;
        IToken IDENT33 = null;
        IToken set35 = null;
        IToken char_literal36 = null;
        Css3Parser.attribRelate_return attribRelate34 = default(Css3Parser.attribRelate_return);


        object char_literal32_tree=null;
        object IDENT33_tree=null;
        object set35_tree=null;
        object char_literal36_tree=null;

        try 
    	{
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:163:2: ( '[' IDENT ( attribRelate ( STRING | IDENT ) )? ']' )
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:163:4: '[' IDENT ( attribRelate ( STRING | IDENT ) )? ']'
            {
            	root_0 = (object)adaptor.GetNilNode();

            	char_literal32=(IToken)Match(input,24,FOLLOW_24_in_attrib629); 
            		char_literal32_tree = (object)adaptor.Create(char_literal32);
            		adaptor.AddChild(root_0, char_literal32_tree);

            	IDENT33=(IToken)Match(input,IDENT,FOLLOW_IDENT_in_attrib631); 
            		IDENT33_tree = (object)adaptor.Create(IDENT33);
            		adaptor.AddChild(root_0, IDENT33_tree);

            	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:163:14: ( attribRelate ( STRING | IDENT ) )?
            	int alt19 = 2;
            	int LA19_0 = input.LA(1);

            	if ( ((LA19_0 >= 26 && LA19_0 <= 28)) )
            	{
            	    alt19 = 1;
            	}
            	switch (alt19) 
            	{
            	    case 1 :
            	        // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:163:15: attribRelate ( STRING | IDENT )
            	        {
            	        	PushFollow(FOLLOW_attribRelate_in_attrib634);
            	        	attribRelate34 = attribRelate();
            	        	state.followingStackPointer--;

            	        	adaptor.AddChild(root_0, attribRelate34.Tree);
            	        	set35 = (IToken)input.LT(1);
            	        	if ( (input.LA(1) >= IDENT && input.LA(1) <= STRING) ) 
            	        	{
            	        	    input.Consume();
            	        	    adaptor.AddChild(root_0, (object)adaptor.Create(set35));
            	        	    state.errorRecovery = false;
            	        	}
            	        	else 
            	        	{
            	        	    MismatchedSetException mse = new MismatchedSetException(null,input);
            	        	    throw mse;
            	        	}


            	        }
            	        break;

            	}

            	char_literal36=(IToken)Match(input,25,FOLLOW_25_in_attrib646); 
            		char_literal36_tree = (object)adaptor.Create(char_literal36);
            		adaptor.AddChild(root_0, char_literal36_tree);


            }

            retval.Stop = input.LT(-1);

            	retval.Tree = (object)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "attrib"

    public class attribRelate_return : ParserRuleReturnScope
    {
        private object tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (object) value; }
        }
    };

    // $ANTLR start "attribRelate"
    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:166:1: attribRelate : ( '=' -> ATTRIBEQUAL | '~=' -> HASVALUE | '|=' -> BEGINSWITH );
    public Css3Parser.attribRelate_return attribRelate() // throws RecognitionException [1]
    {   
        Css3Parser.attribRelate_return retval = new Css3Parser.attribRelate_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken char_literal37 = null;
        IToken string_literal38 = null;
        IToken string_literal39 = null;

        object char_literal37_tree=null;
        object string_literal38_tree=null;
        object string_literal39_tree=null;
        RewriteRuleTokenStream stream_26 = new RewriteRuleTokenStream(adaptor,"token 26");
        RewriteRuleTokenStream stream_27 = new RewriteRuleTokenStream(adaptor,"token 27");
        RewriteRuleTokenStream stream_28 = new RewriteRuleTokenStream(adaptor,"token 28");

        try 
    	{
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:167:2: ( '=' -> ATTRIBEQUAL | '~=' -> HASVALUE | '|=' -> BEGINSWITH )
            int alt20 = 3;
            switch ( input.LA(1) ) 
            {
            case 26:
            	{
                alt20 = 1;
                }
                break;
            case 27:
            	{
                alt20 = 2;
                }
                break;
            case 28:
            	{
                alt20 = 3;
                }
                break;
            	default:
            	    NoViableAltException nvae_d20s0 =
            	        new NoViableAltException("", 20, 0, input);

            	    throw nvae_d20s0;
            }

            switch (alt20) 
            {
                case 1 :
                    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:167:4: '='
                    {
                    	char_literal37=(IToken)Match(input,26,FOLLOW_26_in_attribRelate657);  
                    	stream_26.Add(char_literal37);



                    	// AST REWRITE
                    	// elements:          
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	// wildcard labels: 
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval!=null ? retval.Tree : null);

                    	root_0 = (object)adaptor.GetNilNode();
                    	// 167:9: -> ATTRIBEQUAL
                    	{
                    	    adaptor.AddChild(root_0, (object)adaptor.Create(ATTRIBEQUAL, "ATTRIBEQUAL"));

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;
                    }
                    break;
                case 2 :
                    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:168:4: '~='
                    {
                    	string_literal38=(IToken)Match(input,27,FOLLOW_27_in_attribRelate667);  
                    	stream_27.Add(string_literal38);



                    	// AST REWRITE
                    	// elements:          
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	// wildcard labels: 
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval!=null ? retval.Tree : null);

                    	root_0 = (object)adaptor.GetNilNode();
                    	// 168:9: -> HASVALUE
                    	{
                    	    adaptor.AddChild(root_0, (object)adaptor.Create(HASVALUE, "HASVALUE"));

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;
                    }
                    break;
                case 3 :
                    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:169:4: '|='
                    {
                    	string_literal39=(IToken)Match(input,28,FOLLOW_28_in_attribRelate676);  
                    	stream_28.Add(string_literal39);



                    	// AST REWRITE
                    	// elements:          
                    	// token labels:      
                    	// rule labels:       retval
                    	// token list labels: 
                    	// rule list labels:  
                    	// wildcard labels: 
                    	retval.Tree = root_0;
                    	RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(adaptor, "rule retval", retval!=null ? retval.Tree : null);

                    	root_0 = (object)adaptor.GetNilNode();
                    	// 169:9: -> BEGINSWITH
                    	{
                    	    adaptor.AddChild(root_0, (object)adaptor.Create(BEGINSWITH, "BEGINSWITH"));

                    	}

                    	retval.Tree = root_0;retval.Tree = root_0;
                    }
                    break;

            }
            retval.Stop = input.LT(-1);

            	retval.Tree = (object)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "attribRelate"

    public class declaration_return : ParserRuleReturnScope
    {
        public Declaration declaration;
        private object tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (object) value; }
        }
    };

    // $ANTLR start "declaration"
    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:172:1: declaration returns [Declaration declaration] : IDENT ':' args ;
    public Css3Parser.declaration_return declaration() // throws RecognitionException [1]
    {   
        Css3Parser.declaration_return retval = new Css3Parser.declaration_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken IDENT40 = null;
        IToken char_literal41 = null;
        Css3Parser.args_return args42 = default(Css3Parser.args_return);


        object IDENT40_tree=null;
        object char_literal41_tree=null;

        try 
    	{
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:173:2: ( IDENT ':' args )
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:173:4: IDENT ':' args
            {
            	root_0 = (object)adaptor.GetNilNode();

            	IDENT40=(IToken)Match(input,IDENT,FOLLOW_IDENT_in_declaration697); 
            		IDENT40_tree = (object)adaptor.Create(IDENT40);
            		adaptor.AddChild(root_0, IDENT40_tree);

            	char_literal41=(IToken)Match(input,20,FOLLOW_20_in_declaration699); 
            		char_literal41_tree = (object)adaptor.Create(char_literal41);
            		adaptor.AddChild(root_0, char_literal41_tree);

            	PushFollow(FOLLOW_args_in_declaration701);
            	args42 = args();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, args42.Tree);
            	 retval.declaration =  new Declaration(((IDENT40 != null) ? IDENT40.Text : null), ((args42 != null) ? args42.argList : default(List<object>))); 

            }

            retval.Stop = input.LT(-1);

            	retval.Tree = (object)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "declaration"

    public class args_return : ParserRuleReturnScope
    {
        public List<object> argList;
        private object tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (object) value; }
        }
    };

    // $ANTLR start "args"
    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:176:1: args returns [List<object> argList] : e1= expr ( ( ',' )? e2= expr )* ;
    public Css3Parser.args_return args() // throws RecognitionException [1]
    {   
        Css3Parser.args_return retval = new Css3Parser.args_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken char_literal43 = null;
        Css3Parser.expr_return e1 = default(Css3Parser.expr_return);

        Css3Parser.expr_return e2 = default(Css3Parser.expr_return);


        object char_literal43_tree=null;


        	retval.argList =  new List<object>();

        try 
    	{
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:180:2: (e1= expr ( ( ',' )? e2= expr )* )
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:180:4: e1= expr ( ( ',' )? e2= expr )*
            {
            	root_0 = (object)adaptor.GetNilNode();

            	PushFollow(FOLLOW_expr_in_args724);
            	e1 = expr();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, e1.Tree);
            	 retval.argList.Add(((e1 != null) ? e1.argument : default(object))); 
            	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:181:2: ( ( ',' )? e2= expr )*
            	do 
            	{
            	    int alt22 = 2;
            	    int LA22_0 = input.LA(1);

            	    if ( ((LA22_0 >= IDENT && LA22_0 <= STRING) || LA22_0 == 18) )
            	    {
            	        alt22 = 1;
            	    }


            	    switch (alt22) 
            		{
            			case 1 :
            			    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:182:3: ( ',' )? e2= expr
            			    {
            			    	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:182:3: ( ',' )?
            			    	int alt21 = 2;
            			    	int LA21_0 = input.LA(1);

            			    	if ( (LA21_0 == 18) )
            			    	{
            			    	    alt21 = 1;
            			    	}
            			    	switch (alt21) 
            			    	{
            			    	    case 1 :
            			    	        // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:182:3: ','
            			    	        {
            			    	        	char_literal43=(IToken)Match(input,18,FOLLOW_18_in_args733); 
            			    	        		char_literal43_tree = (object)adaptor.Create(char_literal43);
            			    	        		adaptor.AddChild(root_0, char_literal43_tree);


            			    	        }
            			    	        break;

            			    	}

            			    	PushFollow(FOLLOW_expr_in_args738);
            			    	e2 = expr();
            			    	state.followingStackPointer--;

            			    	adaptor.AddChild(root_0, e2.Tree);
            			    	 retval.argList.Add(((e2 != null) ? e2.argument : default(object))); 

            			    }
            			    break;

            			default:
            			    goto loop22;
            	    }
            	} while (true);

            	loop22:
            		;	// Stops C# compiler whining that label 'loop22' has no statements


            }

            retval.Stop = input.LT(-1);

            	retval.Tree = (object)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "args"

    public class expr_return : ParserRuleReturnScope
    {
        public object argument;
        private object tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (object) value; }
        }
    };

    // $ANTLR start "expr"
    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:186:1: expr returns [object argument] : ( IDENT | STRING | function );
    public Css3Parser.expr_return expr() // throws RecognitionException [1]
    {   
        Css3Parser.expr_return retval = new Css3Parser.expr_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken IDENT44 = null;
        IToken STRING45 = null;
        Css3Parser.function_return function46 = default(Css3Parser.function_return);


        object IDENT44_tree=null;
        object STRING45_tree=null;

        try 
    	{
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:187:2: ( IDENT | STRING | function )
            int alt23 = 3;
            int LA23_0 = input.LA(1);

            if ( (LA23_0 == IDENT) )
            {
                int LA23_1 = input.LA(2);

                if ( (LA23_1 == 29) )
                {
                    alt23 = 3;
                }
                else if ( ((LA23_1 >= IDENT && LA23_1 <= STRING) || LA23_1 == 14 || (LA23_1 >= 17 && LA23_1 <= 19) || LA23_1 == 30) )
                {
                    alt23 = 1;
                }
                else 
                {
                    NoViableAltException nvae_d23s1 =
                        new NoViableAltException("", 23, 1, input);

                    throw nvae_d23s1;
                }
            }
            else if ( (LA23_0 == STRING) )
            {
                alt23 = 2;
            }
            else 
            {
                NoViableAltException nvae_d23s0 =
                    new NoViableAltException("", 23, 0, input);

                throw nvae_d23s0;
            }
            switch (alt23) 
            {
                case 1 :
                    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:187:4: IDENT
                    {
                    	root_0 = (object)adaptor.GetNilNode();

                    	IDENT44=(IToken)Match(input,IDENT,FOLLOW_IDENT_in_expr758); 
                    		IDENT44_tree = (object)adaptor.Create(IDENT44);
                    		adaptor.AddChild(root_0, IDENT44_tree);

                    	 retval.argument =  ((IDENT44 != null) ? IDENT44.Text : null); 

                    }
                    break;
                case 2 :
                    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:188:4: STRING
                    {
                    	root_0 = (object)adaptor.GetNilNode();

                    	STRING45=(IToken)Match(input,STRING,FOLLOW_STRING_in_expr765); 
                    		STRING45_tree = (object)adaptor.Create(STRING45);
                    		adaptor.AddChild(root_0, STRING45_tree);

                    	 retval.argument =  ((STRING45 != null) ? STRING45.Text : null); 

                    }
                    break;
                case 3 :
                    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:189:4: function
                    {
                    	root_0 = (object)adaptor.GetNilNode();

                    	PushFollow(FOLLOW_function_in_expr772);
                    	function46 = function();
                    	state.followingStackPointer--;

                    	adaptor.AddChild(root_0, function46.Tree);
                    	 retval.argument =  ((function46 != null) ? function46.function : default(Function)); 

                    }
                    break;

            }
            retval.Stop = input.LT(-1);

            	retval.Tree = (object)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "expr"

    public class function_return : ParserRuleReturnScope
    {
        public Function function;
        private object tree;
        override public object Tree
        {
        	get { return tree; }
        	set { tree = (object) value; }
        }
    };

    // $ANTLR start "function"
    // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:192:1: function returns [Function function] : IDENT '(' ( args )? ')' ;
    public Css3Parser.function_return function() // throws RecognitionException [1]
    {   
        Css3Parser.function_return retval = new Css3Parser.function_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken IDENT47 = null;
        IToken char_literal48 = null;
        IToken char_literal50 = null;
        Css3Parser.args_return args49 = default(Css3Parser.args_return);


        object IDENT47_tree=null;
        object char_literal48_tree=null;
        object char_literal50_tree=null;

        try 
    	{
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:193:2: ( IDENT '(' ( args )? ')' )
            // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:194:2: IDENT '(' ( args )? ')'
            {
            	root_0 = (object)adaptor.GetNilNode();

            	IDENT47=(IToken)Match(input,IDENT,FOLLOW_IDENT_in_function790); 
            		IDENT47_tree = (object)adaptor.Create(IDENT47);
            		adaptor.AddChild(root_0, IDENT47_tree);

            	char_literal48=(IToken)Match(input,29,FOLLOW_29_in_function792); 
            		char_literal48_tree = (object)adaptor.Create(char_literal48);
            		adaptor.AddChild(root_0, char_literal48_tree);

            	// U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:194:12: ( args )?
            	int alt24 = 2;
            	int LA24_0 = input.LA(1);

            	if ( ((LA24_0 >= IDENT && LA24_0 <= STRING)) )
            	{
            	    alt24 = 1;
            	}
            	switch (alt24) 
            	{
            	    case 1 :
            	        // U:\\moxen\\projects\\Stijl\\trunk\\Open.Web.Stijl\\Css3.g:194:12: args
            	        {
            	        	PushFollow(FOLLOW_args_in_function794);
            	        	args49 = args();
            	        	state.followingStackPointer--;

            	        	adaptor.AddChild(root_0, args49.Tree);

            	        }
            	        break;

            	}

            	char_literal50=(IToken)Match(input,30,FOLLOW_30_in_function797); 
            		char_literal50_tree = (object)adaptor.Create(char_literal50);
            		adaptor.AddChild(root_0, char_literal50_tree);

            	 retval.function =  new Function(((IDENT47 != null) ? IDENT47.Text : null), ((args49 != null) ? input.ToString((IToken)(args49.Start),(IToken)(args49.Stop)) : null)); 

            }

            retval.Stop = input.LT(-1);

            	retval.Tree = (object)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR end "function"

    // Delegated rules


	private void InitializeCyclicDFAs()
	{
	}

 

    public static readonly BitSet FOLLOW_importRule_in_stylesheet95 = new BitSet(new ulong[]{0x000000000108B080UL});
    public static readonly BitSet FOLLOW_mediaGroup_in_stylesheet108 = new BitSet(new ulong[]{0x0000000001088082UL});
    public static readonly BitSet FOLLOW_nested_in_stylesheet118 = new BitSet(new ulong[]{0x0000000001088082UL});
    public static readonly BitSet FOLLOW_ruleset_in_stylesheet128 = new BitSet(new ulong[]{0x0000000001088082UL});
    public static readonly BitSet FOLLOW_set_in_importRule149 = new BitSet(new ulong[]{0x0000000000000080UL});
    public static readonly BitSet FOLLOW_function_in_importRule158 = new BitSet(new ulong[]{0x0000000000004002UL});
    public static readonly BitSet FOLLOW_14_in_importRule160 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_15_in_mediaGroup179 = new BitSet(new ulong[]{0x0000000000000080UL});
    public static readonly BitSet FOLLOW_identList_in_mediaGroup181 = new BitSet(new ulong[]{0x0000000000010000UL});
    public static readonly BitSet FOLLOW_16_in_mediaGroup183 = new BitSet(new ulong[]{0x00000000010A8080UL});
    public static readonly BitSet FOLLOW_ruleSetGroup_in_mediaGroup185 = new BitSet(new ulong[]{0x0000000000020000UL});
    public static readonly BitSet FOLLOW_17_in_mediaGroup187 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_IDENT_in_identList211 = new BitSet(new ulong[]{0x0000000000040002UL});
    public static readonly BitSet FOLLOW_18_in_identList224 = new BitSet(new ulong[]{0x0000000000000080UL});
    public static readonly BitSet FOLLOW_IDENT_in_identList233 = new BitSet(new ulong[]{0x0000000000040002UL});
    public static readonly BitSet FOLLOW_ruleset_in_ruleSetGroup265 = new BitSet(new ulong[]{0x0000000001088082UL});
    public static readonly BitSet FOLLOW_19_in_nested288 = new BitSet(new ulong[]{0x0000000000000080UL});
    public static readonly BitSet FOLLOW_nest_in_nested290 = new BitSet(new ulong[]{0x0000000000010000UL});
    public static readonly BitSet FOLLOW_16_in_nested292 = new BitSet(new ulong[]{0x00000000000A0080UL});
    public static readonly BitSet FOLLOW_properties_in_nested294 = new BitSet(new ulong[]{0x00000000000A0000UL});
    public static readonly BitSet FOLLOW_nested_in_nested297 = new BitSet(new ulong[]{0x00000000000A0000UL});
    public static readonly BitSet FOLLOW_17_in_nested300 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_IDENT_in_nest315 = new BitSet(new ulong[]{0x0000000000300082UL});
    public static readonly BitSet FOLLOW_IDENT_in_nest317 = new BitSet(new ulong[]{0x0000000000300082UL});
    public static readonly BitSet FOLLOW_pseudo_in_nest320 = new BitSet(new ulong[]{0x0000000000300002UL});
    public static readonly BitSet FOLLOW_set_in_pseudo333 = new BitSet(new ulong[]{0x0000000000000080UL});
    public static readonly BitSet FOLLOW_IDENT_in_pseudo339 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_set_in_pseudo345 = new BitSet(new ulong[]{0x0000000000000080UL});
    public static readonly BitSet FOLLOW_function_in_pseudo351 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_selectors_in_ruleset367 = new BitSet(new ulong[]{0x0000000000010000UL});
    public static readonly BitSet FOLLOW_16_in_ruleset369 = new BitSet(new ulong[]{0x0000000000020080UL});
    public static readonly BitSet FOLLOW_properties_in_ruleset371 = new BitSet(new ulong[]{0x0000000000020000UL});
    public static readonly BitSet FOLLOW_17_in_ruleset374 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_selector_in_selectors406 = new BitSet(new ulong[]{0x0000000000040002UL});
    public static readonly BitSet FOLLOW_18_in_selectors417 = new BitSet(new ulong[]{0x0000000001088080UL});
    public static readonly BitSet FOLLOW_selector_in_selectors421 = new BitSet(new ulong[]{0x0000000000040002UL});
    public static readonly BitSet FOLLOW_IDENT_in_selector456 = new BitSet(new ulong[]{0x0000000001D88082UL});
    public static readonly BitSet FOLLOW_set_in_selector469 = new BitSet(new ulong[]{0x0000000001088080UL});
    public static readonly BitSet FOLLOW_IDENT_in_selector500 = new BitSet(new ulong[]{0x0000000001D88082UL});
    public static readonly BitSet FOLLOW_attrib_in_selector514 = new BitSet(new ulong[]{0x0000000001D88082UL});
    public static readonly BitSet FOLLOW_function_in_selector529 = new BitSet(new ulong[]{0x0000000001D88082UL});
    public static readonly BitSet FOLLOW_attrib_in_selector557 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_declaration_in_properties588 = new BitSet(new ulong[]{0x0000000000004002UL});
    public static readonly BitSet FOLLOW_14_in_properties598 = new BitSet(new ulong[]{0x0000000000000080UL});
    public static readonly BitSet FOLLOW_declaration_in_properties602 = new BitSet(new ulong[]{0x0000000000004002UL});
    public static readonly BitSet FOLLOW_14_in_properties616 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_24_in_attrib629 = new BitSet(new ulong[]{0x0000000000000080UL});
    public static readonly BitSet FOLLOW_IDENT_in_attrib631 = new BitSet(new ulong[]{0x000000001E000000UL});
    public static readonly BitSet FOLLOW_attribRelate_in_attrib634 = new BitSet(new ulong[]{0x0000000000000180UL});
    public static readonly BitSet FOLLOW_set_in_attrib636 = new BitSet(new ulong[]{0x0000000002000000UL});
    public static readonly BitSet FOLLOW_25_in_attrib646 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_26_in_attribRelate657 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_27_in_attribRelate667 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_28_in_attribRelate676 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_IDENT_in_declaration697 = new BitSet(new ulong[]{0x0000000000100000UL});
    public static readonly BitSet FOLLOW_20_in_declaration699 = new BitSet(new ulong[]{0x0000000000000180UL});
    public static readonly BitSet FOLLOW_args_in_declaration701 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_expr_in_args724 = new BitSet(new ulong[]{0x0000000000040182UL});
    public static readonly BitSet FOLLOW_18_in_args733 = new BitSet(new ulong[]{0x0000000000000180UL});
    public static readonly BitSet FOLLOW_expr_in_args738 = new BitSet(new ulong[]{0x0000000000040182UL});
    public static readonly BitSet FOLLOW_IDENT_in_expr758 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_STRING_in_expr765 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_function_in_expr772 = new BitSet(new ulong[]{0x0000000000000002UL});
    public static readonly BitSet FOLLOW_IDENT_in_function790 = new BitSet(new ulong[]{0x0000000020000000UL});
    public static readonly BitSet FOLLOW_29_in_function792 = new BitSet(new ulong[]{0x0000000040000180UL});
    public static readonly BitSet FOLLOW_args_in_function794 = new BitSet(new ulong[]{0x0000000040000000UL});
    public static readonly BitSet FOLLOW_30_in_function797 = new BitSet(new ulong[]{0x0000000000000002UL});

}
}